//
//  JMDetailCollectionCell.m
//  PhotoLock
//
//  Created by 赵俊明 on 2017/7/15.
//  Copyright © 2017年 赵俊明. All rights reserved.
//

#import "JMDetailCollectionCell.h"
#import "JMDetailModel.h"

@implementation JMDetailCollectionCell

- (instancetype)initWithFrame:(CGRect)frame
{
    if ([super initWithFrame:frame]) {
        
        self.classImage = [[UIImageView alloc] init];
        _classImage.contentMode = UIViewContentModeScaleAspectFill;
        _classImage.clipsToBounds = YES;
        [self.contentView addSubview:_classImage];
        
        self.backgroundColor = HEXCOLOR(0x2C324C);
        self.layer.cornerRadius = 2;
        self.layer.masksToBounds = YES;
    }
    
    return self;
}

- (void)setModel:(JMDetailModel *)model
{
    _model = model;
    _classImage.image = [UIImage imageNamed:model.imageName];
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    _classImage.frame = self.bounds;
}

@end
